from django.conf.urls import url
from rest_framework.routers import DefaultRouter

from . import views

urlpatterns = [
    #/goods/categories/
    url(r'^categories/$',views.CategoryView.as_view(),name='cagegories'),
    #http://api.meiduo.site:8000/goods/categories/115/hotskus/
    url(r'^categories/(?P<category_id>\d+)/hotskus/$', views.HotSKUListView.as_view(), name='hot'),
    #http://api.meiduo.site:8000/goods/categories/115/skus/?page=1&page_size=5&ordering=-create_time
    url(r'^categories/(?P<category_id>\d+)/skus/$',views.SKUListView.as_view(),name='skuList'),
    url(r'^skus/(?P<sku_id>\d+)/comments/$',views.SKUCommentListView.as_view(),name='skuCommentList'),
]


router = DefaultRouter()
router.register('search',views.GoodsSearchViewSet,base_name='search')
urlpatterns +=router.urls